package com.wiloon.java8x.design.pattern.singleton.enumx;

/**
 * Created by wiloon on 3/25/17;
 */

public enum MyDataBaseSource {
    DATASOURCE;
    private ComboPooledDataSource cpds = null;

     MyDataBaseSource() {
        try {
            cpds = new ComboPooledDataSource();
            System.out.println("-----调用了构造方法------");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void getConnection() {

        cpds.getConnection();

    }

}